package com.cetool.autocms.exception;

import lombok.Getter;

/**
 * 自定义业务异常类
 *
 * @author 端木超群
 * @date 2020/10/27
 */
public class ServiceException extends RuntimeException {

    /**
     * 异常编码
     */
    @Getter
    private final String errorCode;

    /**
     * 构造器
     *
     * @param exceptionInterface 异常枚举
     */
    public ServiceException(ExceptionInterface exceptionInterface) {
        super(exceptionInterface.getExceptionMsg());
        this.errorCode = exceptionInterface.getExceptionCode();
    }
}
